package com.yugao.fintech.framework.assistant.sign;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum SignType {
    MD5("md5"),
    SHA256("sha256"),
    ;
    private final String type;

    public static SignType ofByType(String type) {
        return Arrays.stream(SignType.values()).filter(e -> e.getType().equalsIgnoreCase(type))
                .findFirst().orElseThrow(() -> new SignException("不支持的signType: {}", type));
    }
}
